(function injectVoiceOverride() {
  const code = `
    (function () {
      // 模拟一个假的 SpeechSynthesis 对象
      const fakeSpeechSynthesis = {
        getVoices: function () {
          // 返回空数组，表示没有语音可用
          return [];
        },
        speak: function () {},
        cancel: function () {},
        pause: function () {},
        resume: function () {},
        get speaking() { return false; },
        get paused() { return false; },
        get pending() { return false; },
        addEventListener: function () {},
        removeEventListener: function () {},
        dispatchEvent: function () { return false; }
      };

      // 重写 speechSynthesis，使其变为假的对象
      Object.defineProperty(window, 'speechSynthesis', {
        get: function () {
          if (typeof window.speechSynthesis !== 'undefined') {
            console.warn('Warning: speechSynthesis is being overridden.');
          }
          return fakeSpeechSynthesis;
        },
        configurable: true
      });
    })();
  `;

  // 动态注入页面上下文的 <script>
  const script = document.createElement('script');
  script.textContent = code;
  document.documentElement.appendChild(script);
})();
